<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="./css/style.css">
</head>
<body>
    <script src="js/jQuery-1.0.0.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#login").click(function () {
                //发送ajax请求
                $.ajax({
                    type:"POST",
                    url:"/Employee/login",
                    data:"username=" + $("#username").val() +"&" + "password=" + $("#password").val(),
                    async:true,
                    success:function (json) {
                        if (json.code == 1)
                        {
                            window.location.href = "first.html"
                        } else {
                            alert("登录失败！")
                        }
                    }

                })
            })
        })
    </script>

    <div class="box">
        <h2>登录</h2>
        <div class="input-box">
            <label>用户名</label>
            <input type="text" name="username" id="username">
        </div>
        <div class="input-box">
            <label>密码</label>
            <input type="password" name="password" id="password">
        </div>
        <div class="btn-box">
            <div>
                <button id="login">登录</button>
            </div>
        </div>
    </div>
</body>
</html>